#include <stdio.h>

int compute(const char *lhs, const char *rhs){
    int sum = 0, i = 0;
    for (i = 0; lhs[i] != '\0' || rhs[i] != '\0'; i++) {
        if (lhs[i] == '\0' || rhs[i] == '\0') {
            return -1;
        } else if (lhs[i] != rhs[i]) {
            sum++;
        }
        
    }
    printf("Index: %d. Next is end? base1: %d. base2: %d\n", i, lhs[i]== '\0', rhs[i]== '\0');
    return sum;
}

int main() {
    char lhs[20], rhs[20];
    printf("Enter two DNA sequences:\n");
    int read = scanf("%s\n%s", lhs, rhs);
    if (read != 0) {
        printf("Hamming distance: %d\n", compute(lhs, rhs));
    } else {
        printf("Error reading seq!");
    }
    return 0;
}